package com.tourism.home.dao;

import com.tourism.home.entity.Scenic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ScenicDao {

    //根据类型获取景点
    @Select("select * from tb_scenic where type=#{type}")
    List<Scenic> getScenicByType(@Param("type") String type);

    //根据区域模糊查询
    @Select("select * from tb_scenic where address like \"%\"#{address}\"%\"")
    List<Scenic> getScenicByAddress(@Param("address") String address);

    //根据景点名模糊查询
    @Select("select * from tb_scenic where title like \"%\"#{title}\"%\"")
    List<Scenic> getScenicByTitle(@Param("title") String title);

}